package com.example.bookmanager.Enum;


import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum Enums {
    DELETE(0,"无效"),
    NORMAL(1,"可借阅"),
    FORBDIEN(2,"不可借阅");

    @Getter
    private int code;
    @Getter
    private String name;

    public static Enums getEnum(int code) {
        for (Enums e : Enums.values()) {
            if (e.getCode() == code) {
                return e;
            }
        }
        return null;
    }
}
